package com.swf.seed.spring;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class SimpleBean implements InitializingBean,DisposableBean,BeanNameAware {
	private int age;
	
	public void setAge(int age) {
		this.age = age;
	}
	
	public void afterPropertiesSet() throws Exception {
		System.out.println("afterPropertiesSet:"+this.age);
		this.age++;
		
	}

	public void  sayAge(){
		System.out.println("sayAge:"+this.age);
		this.age++;
	}
	
	@Override
	public void destroy() throws Exception {
		// TODO Auto-generated method stub
		System.out.println("destroy:"+this.age);
		
	}

	@Override
	public void setBeanName(String beanName) {
		System.out.println(beanName);
		
	}
	
}
